#include "Mesh.h"
#include <iostream>

Mesh::Mesh(void)
{
}

Mesh::~Mesh(void)
{
}

void Mesh::addVertex(Vertex3D& p)
{
	vertices.push_back(p);
}

void Mesh::addTexCoord(TexCoord2D& t)
{
	texCoords.push_back(t);
}

void Mesh::addFace(Triangle& f)
{
	faces.push_back(f);
}

void Mesh::addMaterial(GLuint m)
{
	materials.push_back(m);
}

Mesh::FaceIterator Mesh::getFaceStartIter()
{
	return faces.begin();
}

Mesh::FaceIterator Mesh::getFaceEndIter()
{
	return faces.end();
}

Vertex3D& Mesh::getVertexAt(int pos)
{
	// Range check needed!
	return vertices.at(pos);
}

TexCoord2D& Mesh::getTexCoordAt(int pos)
{
	// Range check needed!
	return texCoords.at(pos);
}

void Mesh::debug()
{
	std::cout << "\n---------------------------------------\n";
	std::cout << "Vertex count = " << vertices.size() << "\n";
	std::cout << "Face count = " << faces.size() << "\n";
	std::cout << "TexCoord count = " << texCoords.size() << "\n";
	std::cout << "\n---------------------------------------\n";
}
